package com.alibaba.algo.controller.user;

import com.alibaba.algo.apiimpl.user.SysUserCacheServiceImpl;
import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.usercomponent.vo.req.cache.CacheRequestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/usercenter-admin-app/admin/sysUserCache")
public class SysUserCacheController {

    @Autowired
    private SysUserCacheServiceImpl sysUserCacheService;

    @PostMapping("/deleteUserFromCache")
    public BaseResult deleteUserFromCache(@RequestBody CacheRequestVO cacheRequestVO) {
        return sysUserCacheService.deleteUserFromCache(cacheRequestVO);
    }

    @PostMapping("/batchDeleteUserFromCache")
    public BaseResult batchDeleteUserFromCache(@RequestBody List<CacheRequestVO> cacheRequestVOList) {
        return sysUserCacheService.batchDeleteUserFromCache(cacheRequestVOList);
    }

}
